#version 330

uniform vec2 uGradientOrigin;
uniform vec2 uGradientDirection;
uniform float uGradientLength;
uniform sampler1D uTexture;

out vec4 oFragColor;
in float vCoverage;
in vec2 vVertex;

void main()
{
    vec4 lTex=texture(uTexture,dot(vVertex-uGradientOrigin,uGradientDirection)/uGradientLength);
    oFragColor=vec4(lTex.rgb,lTex.a*vCoverage);
}

